<html>
<header>
	<script src="https://cdn.bootcss.com/vue/2.2.2/vue.min.js"></script>
</header>
<body>
<input type="file" value=""  id="file"  @change='onUpload'>
<script type="text/javascript">
methods: {
	onUpload(e){
	       var formData = new FormData(); 
	        f ormData.append('file', e.target.files[0]);
	        formData.append('type', 'test');
	           $.ajax({
	                url: '/ShopApi/util/upload.weixun'，//这里是后台接口需要换掉
	                type: 'POST',
	                dataType: 'json',
	                cache: false,
	                data: formData,
	                processData: false,
	                contentType: false,
	                success: (res) => {                
	                    if (res.code === 200) {
	                        var img_tpl ='<div class="picture" style="width:108px;float:left;"><img id="preview" src="'+后台返回的tu'pian路径+'" style="width:48px;height:48px;float:left;background-size:cover;"/><span class="r-span"
	 onclick = "onDeletePicture()" style="color:#49BDCC;display:block;float:left;margin-left:10px;line-height:48px;">删除</span></div>';
	                        $("#refund_img").after(img_tpl);
	                    }
	                },
	                error: function(err) {
	                	alert("网络错误");
	                }
	            });
		} 
	}
</script>
</body>
</html>
